home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6104 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.deltanet.com!fuz
  2. From: fuz@deltanet.com (Scott Ellsworth)
  3. Newsgroups: comp.lang.c
  4. Subject: Conversion between 80 and 64 bit doubles
  5. Date: 22 Feb 1996 19:24:40 GMT
  6. Organization: Deltanet Communications, Inc.
  7. Message-ID: <4gifto$aaa@news2.deltanet.com>
  8. NNTP-Posting-Host: nfs3.delta.net
  9.  
  10.  
  11. As part of a project I am working on, I have to convert between
  12. an 80 bit double written on a PC to a 64 bit unix number.  On
  13. most platforms I have seen, this would not be all that hard,
  14. since the one time it has come up, the 64 bit platform (Mac PPC) had a 
  15. conversion routine.  This time, it will not be as kind, as the client 
  16. wants a more general answer.  While I might be able to find a conversion 
  17. routine that will work on his AIX compiler, he has hinted darkly that he 
  18. will be moving to other compilers as well, and could I please write a 
  19. general converter?
  20.  
  21. This is a fairly simple task in one sense - I know the numebrs in 
  22. question will be in range of  64 bit double, and that they will not be 
  23. NANs, so all I must do is convert the valid parts.
  24.  
  25. Does anyone have a source for such a conversion routine, given that the 
  26. platform in question does not have an 80 bit type?  The bit flipping for 
  27. PC-Unix is not a problem - that works already.
  28.  
  29. (BTW, a URL for the official specs for 64 and 80 bit numbers would be 
  30. greatly appreciated.  I have tried to find IEEE 754, but I have not 
  31. succeeded yet, which likely means that I am just searching for it in 
  32. entirely the wrong way.)
  33.  
  34. Scott
  35. --
  36. Scott Ellsworth          fuz@deltanet.com
  37. "When a great many people are unable to find work, unemployment 
  38. results" - Calvin Coolidge, (Stanley Walker, City Editor, p. 131 (1934))
  39. "The barbarian is thwarted at the moat." - Scott Adams
  40.